//
//  Me_MainBtnTitle_View_WX.m
//  ZITHER
//
//  Created by weixin on 2019/5/24.
//  Copyright © 2019 weixn. All rights reserved.
//

#import "Me_MainBtnTitle_View_WX.h"

@implementation Me_MainBtnTitle_View_WX
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        self.backgroundColor = [UIColor whiteColor];
        
        [self setCornerRadiusWithRadius:8 isMasks:YES];

        
        [self setUI];
    }
    return self;
}

-(void)setUI{
    [self addSubview:self.title];
    [self addSubview:self.pic1];
    [self addSubview:self.pic2];
    [self addSubview:self.titleSub];


    [self.pic1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.width.mas_equalTo(16);
        make.left.equalTo(self).offset(15);
        make.top.equalTo(self).offset(15);
    }];
    
    [self.title mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.mas_equalTo(15);
        make.centerY.equalTo(self.pic1).offset(0);
        make.left.equalTo(self.pic1.mas_right).offset(10);
    }];
    
    [self.titleSub mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.mas_equalTo(15);
        make.centerY.equalTo(self.pic1).offset(0);
        make.right.equalTo(self.pic2.mas_left).offset(-5);
    }];
    
    [self.pic2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.width.mas_equalTo(15);
        make.centerY.equalTo(self.pic1).offset(0);
        make.right.equalTo(self).offset(-10);
    }];
}

-(BaseLab *)title{
    if (!_title) {
        _title = [BaseLab initCustomLab:@"标题名称" color:HexColor(0x333333) font:[UIFont fontWithName:@"PingFang-SC-Regular" size:14]];
    }
    return _title;
}

-(BaseLab *)titleSub{
    if (!_titleSub) {
        _titleSub = [BaseLab initCustomLab:@"子标题名称" color:HexColor(0x333333) font:[UIFont fontWithName:@"PingFang-SC-Regular" size:12]];
    }
    return _titleSub;
}

-(BaseImageV *)pic1{
    if (!_pic1) {
        _pic1 = [BaseImageV initCustom:CGRectZero contentMode:1];
//        _pic1.backgroundColor = [UIColor redColor];
    }
    return _pic1;
}

-(BaseImageV *)pic2{
    if (!_pic2) {
        _pic2 = [BaseImageV initCustom:CGRectZero contentMode:1];
        _pic2.image = [UIImage imageNamed:@"我的_查看商家"];
//        _pic2.backgroundColor = [ UIColor redColor];
    }
    return _pic2;
}

@end
